package com.ruoyi.mes.mym.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mes.mym.mapper.MyMeasureMapper;
import com.ruoyi.mes.mym.domain.MyMeasure;
import com.ruoyi.mes.mym.service.IMyMeasureService;

/**
 * 计量单位Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-15
 */
@Service
public class MyMeasureServiceImpl implements IMyMeasureService 
{
    @Autowired
    private MyMeasureMapper myMeasureMapper;

    /**
     * 查询计量单位
     * 
     * @param measureId 计量单位主键
     * @return 计量单位
     */
    @Override
    public MyMeasure selectMyMeasureByMeasureId(Long measureId)
    {
        return myMeasureMapper.selectMyMeasureByMeasureId(measureId);
    }

    /**
     * 查询计量单位列表
     * 
     * @param myMeasure 计量单位
     * @return 计量单位
     */
    @Override
    public List<MyMeasure> selectMyMeasureList(MyMeasure myMeasure)
    {
        return myMeasureMapper.selectMyMeasureList(myMeasure);
    }

    /**
     * 新增计量单位
     * 
     * @param myMeasure 计量单位
     * @return 结果
     */
    @Override
    public int insertMyMeasure(MyMeasure myMeasure)
    {
        myMeasure.setCreateTime(DateUtils.getNowDate());
        return myMeasureMapper.insertMyMeasure(myMeasure);
    }

    /**
     * 修改计量单位
     * 
     * @param myMeasure 计量单位
     * @return 结果
     */
    @Override
    public int updateMyMeasure(MyMeasure myMeasure)
    {
        myMeasure.setUpdateTime(DateUtils.getNowDate());
        return myMeasureMapper.updateMyMeasure(myMeasure);
    }

    /**
     * 批量删除计量单位
     * 
     * @param measureIds 需要删除的计量单位主键
     * @return 结果
     */
    @Override
    public int deleteMyMeasureByMeasureIds(Long[] measureIds)
    {
        return myMeasureMapper.deleteMyMeasureByMeasureIds(measureIds);
    }

    /**
     * 删除计量单位信息
     * 
     * @param measureId 计量单位主键
     * @return 结果
     */
    @Override
    public int deleteMyMeasureByMeasureId(Long measureId)
    {
        return myMeasureMapper.deleteMyMeasureByMeasureId(measureId);
    }
}
